package com.tkp.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tkp.dao.UserMapper;
import com.tkp.entity.User;
import com.tkp.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * @Author: duk
 * @Date: 2021/10/29 14:42
 * @Description: 用户信息操作
 */
@Service
@Slf4j
public class IUserServiceImpl extends ServiceImpl<UserMapper,User> implements IUserService {

    @Resource
    private UserMapper userMapper;

    /**
     * 查询用户信息
     * @param user 用户信息
     * @return 用户信息集合
     */
    @Override
    public List<User> selectUser(User user) {
        List<User> userList = new ArrayList<>();
        String userCode = user.getUserCode();
        log.info("传入信息-->" + user.toString());
        User byUser = userMapper.selectByCode(userCode);
        log.info("查询数据-->" + byUser);
        userList.add(byUser);
        return userList;
    }
}
